# Library
_LIB_TARGET_DIR = ../../smartobjects-core-cpp/library
_LIB_SOURCES_DIR = $(_LIB_TARGET_DIR)/src
_LIB_INCLUDES_DIR = $(_LIB_TARGET_DIR)/include

# UnitTests
_UT_TARGET_DIR = ../../smartobjects-core-cpp/unit-tests
_UT_SOURCES_DIR = $(_UT_TARGET_DIR)/src
_UT_INCLUDES_DIR = $(_UT_TARGET_DIR)/include

# Examples
_CT_TARGET_DIR = ../../examples/cpp/chat
_CT_SOURCES_DIR = $(_CT_TARGET_DIR)/src
_CT_INCLUDES_DIR = $(_CT_TARGET_DIR)/include

# Perf tests
_PT_TARGET_DIR = ../../perftests/cpp
_PT_SOURCES_DIR = $(_PT_TARGET_DIR)/src
_PT_INCLUDES_DIR = $(_PT_TARGET_DIR)/include

lib_LTLIBRARIES = libsmartobjects.la

libsmartobjects_la_SOURCES = \
		$(_LIB_SOURCES_DIR)/coders/StdPacketFormer.cpp \
		$(_LIB_SOURCES_DIR)/coders/HandshakeResponse.cpp \
		$(_LIB_SOURCES_DIR)/coders/StdDataTypesCoderGrammar.cpp \
		$(_LIB_SOURCES_DIR)/coders/IDataTypesCoder.cpp \
		$(_LIB_SOURCES_DIR)/coders/CallInterfaceOperationResponse.cpp \
		$(_LIB_SOURCES_DIR)/coders/CallInterfaceOperationRequest.cpp \
		$(_LIB_SOURCES_DIR)/coders/StdNetworkCommand.cpp \
		$(_LIB_SOURCES_DIR)/coders/HandshakeRequest.cpp \
		$(_LIB_SOURCES_DIR)/coders/StdDataTypesCoder.cpp \
		$(_LIB_SOURCES_DIR)/coders/StdPacketFormerFactory.cpp \
		$(_LIB_SOURCES_DIR)/ISerializableObject.cpp \
		$(_LIB_SOURCES_DIR)/network/URI.cpp \
		$(_LIB_SOURCES_DIR)/network/StdLoginConnectionAuthenticator.cpp \
		$(_LIB_SOURCES_DIR)/network/ManagedClient.cpp \
		$(_LIB_SOURCES_DIR)/network/IManagedServer.cpp \
		$(_LIB_SOURCES_DIR)/network/IManagedNetwork.cpp \
		$(_LIB_SOURCES_DIR)/network/ManagedNetwork.cpp \
		$(_LIB_SOURCES_DIR)/network/ProxyManagedConnection.cpp \
		$(_LIB_SOURCES_DIR)/network/IEndpointCoordinatorFactory.cpp \
		$(_LIB_SOURCES_DIR)/network/IHandshakeManager.cpp \
		$(_LIB_SOURCES_DIR)/network/IEndpointLocation.cpp \
		$(_LIB_SOURCES_DIR)/network/IManagedConnectionListener.cpp \
		$(_LIB_SOURCES_DIR)/network/StdNullConnectionAuthenticator.cpp \
		$(_LIB_SOURCES_DIR)/network/IPacketFormer.cpp \
		$(_LIB_SOURCES_DIR)/network/IAcceptor.cpp \
		$(_LIB_SOURCES_DIR)/network/StdFailOverCoordinator.cpp \
		$(_LIB_SOURCES_DIR)/network/tcp/TCPAcceptorConnection.cpp \
		$(_LIB_SOURCES_DIR)/network/tcp/TCPConnection.cpp \
		$(_LIB_SOURCES_DIR)/network/tcp/SocketURI.cpp \
		$(_LIB_SOURCES_DIR)/network/tcp/SocketMultiplexer.cpp \
		$(_LIB_SOURCES_DIR)/network/tcp/TCPFactory.cpp \
		$(_LIB_SOURCES_DIR)/network/tcp/TCPSharedResources.cpp \
		$(_LIB_SOURCES_DIR)/network/tcp/TCPConnector.cpp \
		$(_LIB_SOURCES_DIR)/network/tcp/TCPAcceptor.cpp \
		$(_LIB_SOURCES_DIR)/network/IManagedConnection.cpp \
		$(_LIB_SOURCES_DIR)/network/ManagedServerConnection.cpp \
		$(_LIB_SOURCES_DIR)/network/IHandshakeManagerFactory.cpp \
		$(_LIB_SOURCES_DIR)/network/IConnectionAuthenticator.cpp \
		$(_LIB_SOURCES_DIR)/network/IServerLoginModule.cpp \
		$(_LIB_SOURCES_DIR)/network/INetworkFactory.cpp \
		$(_LIB_SOURCES_DIR)/network/ManagedConnection.cpp \
		$(_LIB_SOURCES_DIR)/network/IManagedStreamListener.cpp \
		$(_LIB_SOURCES_DIR)/network/StdEndpointCoordinatorFactory.cpp \
		$(_LIB_SOURCES_DIR)/network/INetworkCommand.cpp \
		$(_LIB_SOURCES_DIR)/network/ICoordinatorContext.cpp \
		$(_LIB_SOURCES_DIR)/network/ManagedServer.cpp \
		$(_LIB_SOURCES_DIR)/network/StdRoundRobinCoordinator.cpp \
		$(_LIB_SOURCES_DIR)/network/IHandshakeManagerListener.cpp \
		$(_LIB_SOURCES_DIR)/network/StdHandshakeManagerFactory.cpp \
		$(_LIB_SOURCES_DIR)/network/IManagedConnectionFactory.cpp \
		$(_LIB_SOURCES_DIR)/network/IPacketFormerFactory.cpp \
		$(_LIB_SOURCES_DIR)/network/StdMasterKeyConnectionAuthenticator.cpp \
		$(_LIB_SOURCES_DIR)/network/IEndpointCoordinator.cpp \
		$(_LIB_SOURCES_DIR)/network/StdHandshakeManager.cpp \
		$(_LIB_SOURCES_DIR)/network/IConnectionListener.cpp \
		$(_LIB_SOURCES_DIR)/network/EndpointLocation.cpp \
		$(_LIB_SOURCES_DIR)/network/IAcceptorListener.cpp \
		$(_LIB_SOURCES_DIR)/network/IManagedServerListener.cpp \
		$(_LIB_SOURCES_DIR)/network/IConnector.cpp \
		$(_LIB_SOURCES_DIR)/network/IManagedClient.cpp \
		$(_LIB_SOURCES_DIR)/network/IUserCredentials.cpp \
		$(_LIB_SOURCES_DIR)/network/IStreamListener.cpp \
		$(_LIB_SOURCES_DIR)/network/IConnection.cpp \
		$(_LIB_SOURCES_DIR)/network/ConnectionHandler.cpp \
		$(_LIB_SOURCES_DIR)/IServerSmartObjectImpl.cpp \
		$(_LIB_SOURCES_DIR)/IRemoteSmartObject.cpp \
		$(_LIB_SOURCES_DIR)/IServerSkeleton.cpp \
		$(_LIB_SOURCES_DIR)/IAsyncClientCallback.cpp \
		$(_LIB_SOURCES_DIR)/IAsyncServerCallback.cpp \
		$(_LIB_SOURCES_DIR)/ISmartObject.cpp \
		$(_LIB_SOURCES_DIR)/ISmartBus.cpp \
		$(_LIB_SOURCES_DIR)/SmartBus.cpp \
		$(_LIB_SOURCES_DIR)/IRemoteSmartObjectAvailabilityListener.cpp \
		$(_LIB_SOURCES_DIR)/RequestContext.cpp \
		$(_LIB_SOURCES_DIR)/core/IServerInstancesRegistry.cpp \
		$(_LIB_SOURCES_DIR)/core/LifecycleControlParams.cpp \
		$(_LIB_SOURCES_DIR)/core/ICommandProcessor.cpp \
		$(_LIB_SOURCES_DIR)/core/ICommandProcessorHandler.cpp \
		$(_LIB_SOURCES_DIR)/core/ServerCallback.cpp \
		$(_LIB_SOURCES_DIR)/core/RemoteSmartObject.cpp \
		$(_LIB_SOURCES_DIR)/core/ServerInstancesRegistry.cpp \
		$(_LIB_SOURCES_DIR)/core/SessionId.cpp \
		$(_LIB_SOURCES_DIR)/core/IServerInstancesRegistryListener.cpp \
		$(_LIB_SOURCES_DIR)/core/DefaultCommandProcessorHandler.cpp \
		$(_LIB_SOURCES_DIR)/core/CommandProcessor.cpp \
		$(_LIB_SOURCES_DIR)/core/CallbackHolder.cpp \
		$(_LIB_SOURCES_DIR)/core/SmartBusServer.cpp \
		$(_LIB_SOURCES_DIR)/core/SmartObject.cpp \
		$(_LIB_SOURCES_DIR)/core/ServerSkeleton.cpp \
		$(_LIB_SOURCES_DIR)/core/SmartBusClient.cpp \
		$(_LIB_SOURCES_DIR)/IServerSyncSmartObjectImpl.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/StdSymmetricEncrypter.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/IDataEncrypter.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/IAsymmetricDataEncrypter.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/StdAsymmetricEncrypter.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/StdDataEncrypterFactory.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/crypto/PublicKey.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/crypto/PrivateKey.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/crypto/SecretKey.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/crypto/KeyPair.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/IDataEncrypterFactory.cpp \
		$(_LIB_SOURCES_DIR)/encrypters/ISymmetricDataEncrypter.cpp

libsmartobjects_la_CXXFLAGS = -I$(_LIB_INCLUDES_DIR)
libsmartobjects_la_LDFLAGS = -release $(VERSION) -lboost_thread$(BOOST_LIB_POSTFIX) -lboost_regex$(BOOST_LIB_POSTFIX) -lcpputils -lgmp -lcrypto $(OS_SPECIFIC_LDFLAGS)

noinst_PROGRAMS = SmartObjectsUnitTests SmartObjectChatExample SmartObjectPerfTests
nodist_SmartObjectsUnitTests_SOURCES= \
		$(_UT_SOURCES_DIR)/coders/StdPacketFormerTest.cpp \
		$(_UT_SOURCES_DIR)/coders/StdDataTypesCoderTest.cpp \
		$(_UT_SOURCES_DIR)/coders/StdNetworkCommandTest.cpp \
		$(_UT_SOURCES_DIR)/recursive-includes/recursive_include_test.cpp \
		$(_UT_SOURCES_DIR)/Main.cpp \
		$(_UT_SOURCES_DIR)/SmartBusTest.cpp \
		$(_UT_SOURCES_DIR)/network/EndpointLocationTests.cpp \
		$(_UT_SOURCES_DIR)/network/TCPSyncPacketExchangeTest.cpp \
		$(_UT_SOURCES_DIR)/network/ManagedNetworkTests.cpp \
		$(_UT_SOURCES_DIR)/network/StdHandshakeManagerTests.cpp \
		$(_UT_SOURCES_DIR)/network/testers/ManagedServerListenerTester.cpp \
		$(_UT_SOURCES_DIR)/network/testers/TestTCPServer.cpp \
		$(_UT_SOURCES_DIR)/network/testers/ConnectionListenerTester.cpp \
		$(_UT_SOURCES_DIR)/network/testers/ManagedConnectionListenerTester.cpp \
		$(_UT_SOURCES_DIR)/network/testers/AcceptorListenerTester.cpp \
		$(_UT_SOURCES_DIR)/network/testers/TestTCPClient.cpp \
		$(_UT_SOURCES_DIR)/network/TCPNetworkTests.cpp \
		$(_UT_SOURCES_DIR)/SimpleInterfaceTest.cpp \
		$(_UT_SOURCES_DIR)/core/DummySyncSkeletonTest.cpp \
		$(_UT_SOURCES_DIR)/encrypters/StdAsymmetricEncrypterTest.cpp \
		$(_UT_SOURCES_DIR)/encrypters/StdSymmetricEncrypterTest.cpp

SmartObjectsUnitTests_LDADD = libsmartobjects.la
SmartObjectsUnitTests_CXXFLAGS = -I$(_LIB_INCLUDES_DIR) -I$(_UT_INCLUDES_DIR) -I$(_UT_TARGET_DIR)/generated-testmodel
SmartObjectsUnitTests_LDFLAGS = -lboost_unit_test_framework$(BOOST_LIB_POSTFIX) -lboost_test_exec_monitor$(BOOST_LIB_POSTFIX) -lcpputils -lgmp $(OS_SPECIFIC_LDFLAGS)

nodist_SmartObjectChatExample_SOURCES= \
			$(_CT_SOURCES_DIR)/Main.cpp \
			$(_CT_SOURCES_DIR)/client/ChatClientImpl.cpp \
			$(_CT_SOURCES_DIR)/server/ChatServiceImpl.cpp \
			$(_CT_SOURCES_DIR)/server/ChatSessionImpl.cpp

SmartObjectChatExample_LDADD = libsmartobjects.la
SmartObjectChatExample_CXXFLAGS = -I$(_LIB_INCLUDES_DIR) -I$(_CT_INCLUDES_DIR) -I$(_CT_TARGET_DIR)/generated
SmartObjectChatExample_LDFLAGS = -lcpputils -lgmp -lboost_program_options$(BOOST_LIB_POSTFIX) $(OS_SPECIFIC_LDFLAGS)


nodist_SmartObjectPerfTests_SOURCES= \
			$(_PT_SOURCES_DIR)/Main.cpp \
			$(_PT_SOURCES_DIR)/client/AsyncPerfClientImpl.cpp \
			$(_PT_SOURCES_DIR)/client/AbstractPerfTestImpl.cpp \
			$(_PT_SOURCES_DIR)/client/SyncPerfClientImpl.cpp \
			$(_PT_SOURCES_DIR)/server/PerfTestServiceSyncImpl.cpp

SmartObjectPerfTests_LDADD = libsmartobjects.la
SmartObjectPerfTests_CXXFLAGS = -I$(_LIB_INCLUDES_DIR) -I$(_PT_INCLUDES_DIR) -I$(_PT_TARGET_DIR)/generated
SmartObjectPerfTests_LDFLAGS = -lcpputils -lgmp -lboost_program_options$(BOOST_LIB_POSTFIX) $(OS_SPECIFIC_LDFLAGS)

